/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pyfntbpoaprog")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pyfntbpoaprog.findAll", query = "SELECT p FROM Pyfntbpoaprog p"),
    @NamedQuery(name = "Pyfntbpoaprog.findByPyfntbpoaprogid", query = "SELECT p FROM Pyfntbpoaprog p WHERE p.pyfntbpoaprogid = :pyfntbpoaprogid"),
    @NamedQuery(name = "Pyfntbpoaprog.findByMetanual", query = "SELECT p FROM Pyfntbpoaprog p WHERE p.metanual = :metanual"),
    @NamedQuery(name = "Pyfntbpoaprog.findByProgcuatrim1", query = "SELECT p FROM Pyfntbpoaprog p WHERE p.progcuatrim1 = :progcuatrim1"),
    @NamedQuery(name = "Pyfntbpoaprog.findByProgcuatrim2", query = "SELECT p FROM Pyfntbpoaprog p WHERE p.progcuatrim2 = :progcuatrim2"),
    @NamedQuery(name = "Pyfntbpoaprog.findByProgcuatrim3", query = "SELECT p FROM Pyfntbpoaprog p WHERE p.progcuatrim3 = :progcuatrim3"),
    @NamedQuery(name = "Pyfntbpoaprog.findByResponsables", query = "SELECT p FROM Pyfntbpoaprog p WHERE p.responsables = :responsables"),
    @NamedQuery(name = "Pyfntbpoaprog.findByFecharegistro", query = "SELECT p FROM Pyfntbpoaprog p WHERE p.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Pyfntbpoaprog.findByObservaciones", query = "SELECT p FROM Pyfntbpoaprog p WHERE p.observaciones = :observaciones")})
public class Pyfntbpoaprog implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pyfntbpoaprogid")
    private Integer pyfntbpoaprogid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 800)
    @Column(name = "metanual")
    private String metanual;
    @Basic(optional = false)
    @NotNull
    @Column(name = "progcuatrim1")
    private double progcuatrim1;
    @Basic(optional = false)
    @NotNull
    @Column(name = "progcuatrim2")
    private double progcuatrim2;
    @Basic(optional = false)
    @NotNull
    @Column(name = "progcuatrim3")
    private double progcuatrim3;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 500)
    @Column(name = "responsables")
    private String responsables;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyfntbpoaprogid")
    private Collection<Pyfntbprogmeta> pyfntbprogmetaCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyfntbpoaprogid")
    private Collection<Pyfntbreqper> pyfntbreqperCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyfntbpoaprogid")
    private Collection<Pyfntbproindic> pyfntbproindicCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyfntbpoaprogid")
    private Collection<Pyfntbactivmed> pyfntbactivmedCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyfntbpoaprogid")
    private Collection<Pyfntbrequer> pyfntbrequerCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyfntbpoaprogid")
    private Collection<Pyfntbejegasto> pyfntbejegastoCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyfntbpoaprogid")
    private Collection<Pyfntbreqviatico> pyfntbreqviaticoCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyfntbpoaprogid")
    private Collection<Pyfntbprogres> pyfntbprogresCollection;
    @JoinColumn(name = "pyfntbpoaid", referencedColumnName = "pyfntbpoaid")
    @ManyToOne(optional = false)
    private Pyfntbpoa pyfntbpoaid;
    @JoinColumn(name = "pyfntbactivpoaid", referencedColumnName = "pyfntbactivpoaid")
    @ManyToOne(optional = false)
    private Pyfntbactivpoa pyfntbactivpoaid;

    public Pyfntbpoaprog() {
    }

    public Pyfntbpoaprog(Integer pyfntbpoaprogid) {
        this.pyfntbpoaprogid = pyfntbpoaprogid;
    }

    public Pyfntbpoaprog(Integer pyfntbpoaprogid, String metanual, double progcuatrim1, double progcuatrim2, double progcuatrim3, String responsables, Date fecharegistro, String observaciones) {
        this.pyfntbpoaprogid = pyfntbpoaprogid;
        this.metanual = metanual;
        this.progcuatrim1 = progcuatrim1;
        this.progcuatrim2 = progcuatrim2;
        this.progcuatrim3 = progcuatrim3;
        this.responsables = responsables;
        this.fecharegistro = fecharegistro;
        this.observaciones = observaciones;
    }

    public Integer getPyfntbpoaprogid() {
        return pyfntbpoaprogid;
    }

    public void setPyfntbpoaprogid(Integer pyfntbpoaprogid) {
        this.pyfntbpoaprogid = pyfntbpoaprogid;
    }

    public String getMetanual() {
        return metanual;
    }

    public void setMetanual(String metanual) {
        this.metanual = metanual;
    }

    public double getProgcuatrim1() {
        return progcuatrim1;
    }

    public void setProgcuatrim1(double progcuatrim1) {
        this.progcuatrim1 = progcuatrim1;
    }

    public double getProgcuatrim2() {
        return progcuatrim2;
    }

    public void setProgcuatrim2(double progcuatrim2) {
        this.progcuatrim2 = progcuatrim2;
    }

    public double getProgcuatrim3() {
        return progcuatrim3;
    }

    public void setProgcuatrim3(double progcuatrim3) {
        this.progcuatrim3 = progcuatrim3;
    }

    public String getResponsables() {
        return responsables;
    }

    public void setResponsables(String responsables) {
        this.responsables = responsables;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    @XmlTransient
    public Collection<Pyfntbprogmeta> getPyfntbprogmetaCollection() {
        return pyfntbprogmetaCollection;
    }

    public void setPyfntbprogmetaCollection(Collection<Pyfntbprogmeta> pyfntbprogmetaCollection) {
        this.pyfntbprogmetaCollection = pyfntbprogmetaCollection;
    }

    @XmlTransient
    public Collection<Pyfntbreqper> getPyfntbreqperCollection() {
        return pyfntbreqperCollection;
    }

    public void setPyfntbreqperCollection(Collection<Pyfntbreqper> pyfntbreqperCollection) {
        this.pyfntbreqperCollection = pyfntbreqperCollection;
    }

    @XmlTransient
    public Collection<Pyfntbproindic> getPyfntbproindicCollection() {
        return pyfntbproindicCollection;
    }

    public void setPyfntbproindicCollection(Collection<Pyfntbproindic> pyfntbproindicCollection) {
        this.pyfntbproindicCollection = pyfntbproindicCollection;
    }

    @XmlTransient
    public Collection<Pyfntbactivmed> getPyfntbactivmedCollection() {
        return pyfntbactivmedCollection;
    }

    public void setPyfntbactivmedCollection(Collection<Pyfntbactivmed> pyfntbactivmedCollection) {
        this.pyfntbactivmedCollection = pyfntbactivmedCollection;
    }

    @XmlTransient
    public Collection<Pyfntbrequer> getPyfntbrequerCollection() {
        return pyfntbrequerCollection;
    }

    public void setPyfntbrequerCollection(Collection<Pyfntbrequer> pyfntbrequerCollection) {
        this.pyfntbrequerCollection = pyfntbrequerCollection;
    }

    @XmlTransient
    public Collection<Pyfntbejegasto> getPyfntbejegastoCollection() {
        return pyfntbejegastoCollection;
    }

    public void setPyfntbejegastoCollection(Collection<Pyfntbejegasto> pyfntbejegastoCollection) {
        this.pyfntbejegastoCollection = pyfntbejegastoCollection;
    }

    @XmlTransient
    public Collection<Pyfntbreqviatico> getPyfntbreqviaticoCollection() {
        return pyfntbreqviaticoCollection;
    }

    public void setPyfntbreqviaticoCollection(Collection<Pyfntbreqviatico> pyfntbreqviaticoCollection) {
        this.pyfntbreqviaticoCollection = pyfntbreqviaticoCollection;
    }

    @XmlTransient
    public Collection<Pyfntbprogres> getPyfntbprogresCollection() {
        return pyfntbprogresCollection;
    }

    public void setPyfntbprogresCollection(Collection<Pyfntbprogres> pyfntbprogresCollection) {
        this.pyfntbprogresCollection = pyfntbprogresCollection;
    }

    public Pyfntbpoa getPyfntbpoaid() {
        return pyfntbpoaid;
    }

    public void setPyfntbpoaid(Pyfntbpoa pyfntbpoaid) {
        this.pyfntbpoaid = pyfntbpoaid;
    }

    public Pyfntbactivpoa getPyfntbactivpoaid() {
        return pyfntbactivpoaid;
    }

    public void setPyfntbactivpoaid(Pyfntbactivpoa pyfntbactivpoaid) {
        this.pyfntbactivpoaid = pyfntbactivpoaid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pyfntbpoaprogid != null ? pyfntbpoaprogid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pyfntbpoaprog)) {
            return false;
        }
        Pyfntbpoaprog other = (Pyfntbpoaprog) object;
        if ((this.pyfntbpoaprogid == null && other.pyfntbpoaprogid != null) || (this.pyfntbpoaprogid != null && !this.pyfntbpoaprogid.equals(other.pyfntbpoaprogid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pyfntbpoaprog[ pyfntbpoaprogid=" + pyfntbpoaprogid + " ]";
    }
    
}
